package contentDetermination;

import java.util.Hashtable;

public class Group extends Agent{
	
	private String lider;
	private long creationTime;
	private long endTime;
	
	Hashtable<String, Follower> followers;
	
	
	public Group(String lider, long creationTime){
		super("Group_"+lider, "Group");
		this.lider = lider;
		this.creationTime = creationTime;	
		endTime = -1;
		followers = new Hashtable<String, Follower>();
	}
	
	public Group(String lider, long creationTime, String follower){
		super("Group_"+lider, "Group");
		this.lider = lider;
		this.creationTime = creationTime;
		endTime = -1;
		followers = new Hashtable<String, Follower>();
		followers.put(follower, new Follower(creationTime, follower,lider));
	}

	public String getLider() {
		return lider;
	}

	public void setLider(String lider) {
		this.lider = lider;
	}

	public long getCreationTime() {
		return creationTime;
	}

	public void setCreationTime(long creationTime) {
		this.creationTime = creationTime;
	}

	public long getEndTime() {
		return endTime;
	}
	
	public boolean isActive(){
		return (endTime == -1);
	}

	public void setEndTime(long endTime) {
		this.endTime = endTime;
	}
	
	public void addFollower(String name, long time){
		followers.put("name", new Follower(time, name, lider));
	}
	
	public Follower getFollower(String name){
		return (followers.get(name));
	}
	
	public int getInteresPrimario(){
		return (super.getInteresPrimario()+followers.size());
	}
	
}
